<!--选择活动主题的组件，主要用于店铺首页设置时，各模块里内容的链接，如链接到产品、活动页等-->
<style scoped lang="less">
	@import "select-subject";
</style>
<template>
	<div class="select-subject-container">
<!--		<Tabs v-model="select">-->
<!--			<TabPane v-for="tab in tabs" :label="tab.name" :name="tab.value">-->
<!--				<div class="select-subject-items-container">-->
<!--					<template v-if="tab.value===(GLOBAL.TYPE_LINK_ACTIVE+'')">-->
<!--						<ActiveSelect @subject-selected="selected"></ActiveSelect>-->
<!--					</template>-->
<!--					<template v-else-if="tab.value===(GLOBAL.TYPE_LINK_CATEGORY+'')">-->
<!--						<CategorySelect :select="true" @subject-selected="selected"></CategorySelect>-->
<!--					</template>-->
<!--				</div>-->
<!--			</TabPane>-->
<!--		</Tabs>-->
		<div class="select-subject-items-container">
			<template v-if="type===GLOBAL.TYPE_LINK_ACTIVE">
				<ActiveSelect @active-selected="selected"></ActiveSelect>
			</template>
			<template v-else-if="type===GLOBAL.TYPE_LINK_CATEGORY">
				<CategorySelect :select="true" @category-selected="selected"></CategorySelect>
			</template>
			<template v-else-if="type===GLOBAL.TYPE_LINK_SUBJECT">
				<SubjectSelect :select="true" @subject-selected="selected"></SubjectSelect>
			</template>
		</div>
	</div>
</template>
<script>
  import ActiveSelect from './active-select'
  import CategorySelect from '@/view/categorys/category-list.vue'
  import SubjectSelect from '@/view/subject/subject-list.vue'

  export default {
    name: 'select-subject',
    components: {
      ActiveSelect,
      CategorySelect,
      SubjectSelect
    },
    data() {
      return {
        // select: 0,
        // tabs: [{value: this.GLOBAL.TYPE_LINK_ACTIVE+'', name: '产品'}, {value: this.GLOBAL.TYPE_LINK_CATEGORY+'', name: '分类'}]
      };
    },
    props: {
      type: {type: Number, default: null},
      flag: {type: Number, default: null}
    },
    methods: {
      selected(data) {
        data.flag = this.flag;
        this.$emit('subject-ok', {data: data, flag: this.flag});
        // console.log(data);
      }
    },
    created() {
    }

  }
</script>
